home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ray Dream Studio
/
Ray Dream Studio (CDRAYD1) (Ray Dream) (1995).iso
/
DREAMSDK.WIN
/
INCLUDE
/
QLIB.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-06
|
9KB
|
247 lines
/* $Id: qlib.h 1.1 1995/06/29 09:36:47 YannPC Exp $ */
#ifndef __QLIB__
#define __QLIB__
#ifndef _WIN31
#define __cdecl
#endif
#if defined(qFIXEDIsQuickFix) && defined(qNewQLib)
inline QuickFix QFM(const QuickFix &xx,const QuickFix &yy) {
return xx*yy;
}
inline QuickFix QFD(const QuickFix &xx,const QuickFix &yy) {
return xx/yy;
}
inline QuickFix QFDClip(const QuickFix &xx,const QuickFix &yy) {
return xx/yy;
}
inline QuickFix QFDNoClip(const QuickFix &xx,const QuickFix &yy) {
return xx/yy;
}
#elif defined(qQFixIsFloat) && defined(qNewQLib)
#define QFM(xx,yy) ((xx)*(yy))
#define QFD(xx,yy) ((xx)/(yy))
#define QFDClip(xx,yy) ((xx)/(yy))
#define QFDNoClip(xx,yy) ((xx)/(yy))
#else
typedef struct QSegment {
long order;
long x1,y1;
long x2,y2;
long x3,y3;
long x4,y4;
} QSegment;
#ifdef __cplusplus
extern "C" {
#endif
long QFDClip(long xx,long yy);
long QFD(long xx,long yy);
long QFMClip(long xx, long yy);
long IntersectSegLine(const long *seg,const long *line);
long CalculateCurve(long P0,long P1,long P2,long lamda);
long CalculateBezier(long P0,long P1,long P2,long P3,long lamda);
#if defined(_WIN31) || defined(qPowerPC)
long __cdecl QFM(long xx,long yy);
long __cdecl QFMOV(long xx,long yy,short *overflow);
long __cdecl QLM(long xx,long yy,unsigned long *zzlow);
long __cdecl QFDNoClip(long xx,long yy);
void SubLine(const QSegment *seg,QSegment *left,QSegment *right);
void SubCurve(const QSegment *seg,QSegment *left,QSegment *right);
void SubBezier(const QSegment *seg,QSegment *left,QSegment *right);
#endif
#ifdef __cplusplus
}
#endif
#if !defined(_WIN31) && !defined(qPowerPC)
long QFMOV(long xx, long yy, short* overflow) = {
0x2217, //MOVE.L (A7),D1
0x4C2F,0x1C00,0x0004, //MULS.L $0004(A7),D0:D1
0x4840, //SWAP D0
0x4841, //SWAP D1
0x206F,0x0008, //MOVEA.L $0008(A7),A0
0X3080, //MOVE.W D0,(A0)
0x3001 //MOVE.W D1,D0
};
long QFM(long xx, long yy) = {
0x2217, //MOVE.L (A7),D1
0x4C2F,0x1C00,0x0004, //MULS.L $0004(A7),D0:D1
0x4840, //SWAP D0
0x4841, //SWAP D1
0x3001 //MOVE.W D1,D0
};
long QFDNoClip(long xx,long yy) = {
0x2017, //MOVE.L (A7),D0
0x2200, //MOVE.L D0,D1
0xE188, //LSL.L #$8,D0
0xE188, //LSL.L #$8,D0
0xE081, //ASR.L #$8,D1
0xE081, //ASR.L #$8,D1
0x4C6F,0x0C01,0x0004 //DIVS.L $0004(A7),D1:D0
};
long QLM(long xx,long yy,unsigned long *low) = {
0x2217, //MOVE.L (A7),D1
0x4C2F,0x1C00,0x0004, //MULS.L $0004(A7),D0:D1
0x206F,0x0008, //MOVEA.L $0008(A7),A0
0x2081 //MOVE.L D1,(A0)
};
void SubLine(const QSegment *seg,QSegment *left,QSegment *right) = {
0x2F0A, //MOVE.L A2,-(A7)
0x206F,0x0004, //MOVEA.L $0004(A7),A0
0x226F,0x0008, //MOVEA.L $0008(A7),A1
0x246F,0x000C, //MOVEA.L $000C(A7),A2
0x2368,0x0004,0x0004, //MOVE.L $0004(A0),$0004(A1)
0x2368,0x0008,0x0008, //MOVE.L $0008(A0),$0008(A1)
0x2568,0x000C,0x000C, //MOVE.L $000C(A0),$000C(A2)
0x2568,0x0010,0x0010, //MOVE.L $0010(A0),$0010(A2)
//0x2010, //MOVE.L (A0),D0
0x2028, 0x0004, // MOVE.L $0004(A0),D0 YC
0xD0A8,0x000C, //ADD.L $000C(A0),D0
0xE280, //ASR.L #$1,D0
0x2340,0x000C, //MOVE.L D0,$000C(A1)
//0x2480, //MOVE.L D0,(A2)
0x2540, 0x0004, //MOVE.L D0,$0004(A2) YC
0x2028,0x0008, //MOVE.L $0008(A0),D0
0xD0A8,0x00010, //ADD.L $0010(A0),D0
0xE280, //ASR.L #$1,D0
0x2340,0x0010, //MOVE.L D0,$0010(A1)
0x2540,0x0008, //MOVE.L D0,$0008(A2)
0x245F //MOVEA.L (A7)+,A2
};
void SubCurve(const QSegment *seg,QSegment *left,QSegment *right) = {
0x2F0A, //MOVE.L A2,-(A7)
0x206F,0x0004, //MOVEA.L $0004(A7),A0
0x226F,0x0008, //MOVEA.L $0008(A7),A1
0x246F,0x000C, //MOVEA.L $000C(A7),A2
0x2368,0x0004,0x0004, //MOVE.L $0004(A0),$0004(A1)
0x2368,0x0008,0x0008, //MOVE.L $0008(A0),$0008(A1)
0x2568,0x0014,0x0014, //MOVE.L $0014(A0),$0014(A2)
0x2568,0x0018,0x0018, //MOVE.L $0018(A0),$0018(A2)
//0x2010, //MOVE.L (A0),D0
0x2028, 0x0004, //MOVE.L $0004(A0),D0 YC
0xD0A8,0x000C, //ADD.L $000C(A0),D0
0xE280, //ASR.L #$1,D0
0x2340,0x000C, //MOVE.L D0,$000C(A1)
0x2028,0x0008, //MOVE.L $0008(A0),D0
0xD0A8,0x0010, //ADD.L $0010(A0),D0
0xE280, //ASR.L #$1,D0
0x2340,0x0010, //MOVE.L D0,$0010(A1)
0x2028,0x000C, //MOVE.L $000C(A0),D0
0xD0A8,0x0014, //ADD.L $0014(A0),D0
0xE280, //ASR.L #$1,D0
0x2540,0x000C, //MOVE.L D0,$000C(A2)
0x2028,0x0010, //MOVE.L $0010(A0),D0
0xD0A8,0x0018, //ADD.L $0018(A0),D0
0xE280, //ASR.L #$1,D0
0x2540,0x0010, //MOVE.L D0,$0010(A2)
0x2029,0x000C, //MOVE.L $000C(A1),D0
0xD0AA,0x000C, //ADD.L $000C(A2),D0
0xE280, //ASR.L #$1,D0
0x2340,0x0014, //MOVE.L D0,$0014(A1)
//0x2480, //MOVE.L D0,(A2)
0x2540, 0x0004, //MOVE.L D0,$0004(A2) YC
0x2029,0x0010, //MOVE.L $0010(A1),D0
0xD0AA,0x0010, //ADD.L $0010(A2),D0
0xE280, //ASR.L #$1,D0
0x2340,0x0018, //MOVE.L D0,$0018(A1)
0x2540,0x0008, //MOVE.L D0,$0008(A2)
0x245F //MOVEA.L (A7)+,A2
};
void SubBezier(const QSegment *seg,QSegment *left,QSegment *right) = {
0x2F0A, //MOVE.L A2,-(A7)
0x206F,0x0004, //MOVEA.L $0004(A7),A0
0x226F,0x0008, //MOVEA.L $0008(A7),A1
0x246F,0x000C, //MOVEA.L $000C(A7),A2
0x2368,0x0004,0x0004, //MOVE.L $0004(A0),$0004(A1)
0x2368,0x0008,0x0008, //MOVE.L $0008(A0),$0008(A1)
0x2568,0x001C,0x001C, //MOVE.L $001C(A0),$001C(A2)
0x2568,0x0020,0x0020, //MOVE.L $0020(A0),$0020(A2)
//0x2010, //MOVE.L (A0),D0
0x2028, 0x0004, //MOVE.L $0004(A0),D0 YC
0xD0A8,0x000C, //ADD.L $000C(A0),D0
0xE280, //ASR.L #$1,D0
0x2340,0x000C, //MOVE.L D0,$000C(A1)
0x2028,0x0008, //MOVE.L $0008(A0),D0
0xD0A8,0x0010, //ADD.L $0010(A0),D0
0xE280, //ASR.L #$1,D0
0x2340,0x0010, //MOVE.L D0,$0010(A1)
0x2028,0x0014, //MOVE.L $0014(A0),D0
0xD0A8,0x001C, //ADD.L $001C(A0),D0
0xE280, //ASR.L #$1,D0
//0x2540,0x0010, //MOVE.L D0,$0010(A2)
0x2540,0x0014, //MOVE.L D0,$0014(A2) YC
0x2028,0x0018, //MOVE.L $0018(A0),D0
0xD0A8,0x0020, //ADD.L $0020(A0),D0
0xE280, //ASR.L #$1,D0
0x2540,0x0018, //MOVE.L D0,$0018(A2)
0x2228,0x000C, //MOVE.L $000C(A0),D1
0xD2A8,0x0014, //ADD.L $0014(A0),D1
0xE281, //ASR.L #$1,D1
0x2029,0x000C, //MOVE.L $000C(A1),D0
0xD081, //ADD.L D1,D0
0xE280, //ASR.L #$1,D0
0x2340,0x0014, //MOVE.L D0,$0014(A1)
0x202A,0x0014, //MOVE.L $0014(A2),D0
0xD081, //ADD.L D1,D0
0xE280, //ASR.L #$1,D0
0x2540,0x000C, //MOVE.L D0,$000C(A2)
0x2228,0x0010, //MOVE.L $0010(A0),D1
0xD2A8,0x0018, //ADD.L $0018(A0),D1
0xE281, //ASR.L #$1,D1
0x2029,0x0010, //MOVE.L $0010(A1),D0
0xD081, //ADD.L D1,D0
0xE280, //ASR.L #$1,D0
0x2340,0x0018, //MOVE.L D0,$0018(A1)
0x202A,0x0018, //MOVE.L $0018(A2),D0
0xD081, //ADD.L D1,D0
0xE280, //ASR.L #$1,D0
0x2540,0x0010, //MOVE.L D0,$0010(A2)
0x2029,0x0014, //MOVE.L $0014(A1),D0
0xD0AA,0x000C, //ADD.L $000C(A2),D0
0xE280, //ASR.L #$1,D0
0x2340,0x001C, //MOVE.L D0,$001C(A1)
//0x2480, //MOVE.L D0,(A2)
0x2540, 0x0004, //MOVE.L D0,$0004(A2) YC
0x2029,0x0018, //MOVE.L $0018(A1),D0
0xD0AA,0x0010, //ADD.L $0010(A2),D0
0xE280, //ASR.L #$1,D0
0x2340,0x0020, //MOVE.L D0,$0020(A1)
0x2540,0x0008, //MOVE.L D0,$0008(A2)
0x245F //MOVEA.L (A7)+,A2
};
#endif
#endif
#endif